solum lege carpe hauri
Translation status: 繁體中文 reader-locale proof. Term names and code fences follow the zh-Hant pack; supporting prose may still be English.
solum file reads are shape-specific: lege<textus>, carpe (lista<textus>), hauri (octeti).
Syntax: solum.read_file<textus>(via) | call 'solum:carpe' (via) ↦ lista<textus> | call 'solum:hauri' (via) ↦ octeti
Category#
ad
Related#
Examples#
radix/corpus/ad/solum-lege-generic.fab (canonical · concept)#
solum file reads are shape-specific: lege<textus>, carpe (lista<textus>), hauri (octeti).
# =============================================================================
# solum lege carpe hauri — solum file reads are shape-specific routes.
# =============================================================================
#
# What this teaches:
# • Shape-specific reads — `solum.read_file<textus>` reads a file as text;
# `solum:carpe` reads it as a line list; `solum:hauri` reads raw bytes
# • Manifest-backed surface — each route declares exactly one result shape in
# the solum provider manifest, so the materialized target always matches
#
# Common mistakes:
# • assuming one generic `solum.read_file<T>` reads every shape — `lege` is
# text-only; use `carpe` for `lista<textus>` and `hauri` for `octeti`
#
# See also: ad, solum, lege, carpe, hauri
# =============================================================================
# solum file reads — lege (text) / carpe (lines) / hauri (bytes)
#
# The provider contract (hosts/crates/solum manifest) keeps one result shape
# per route: `solum:lege` → textus, `solum:carpe` → lista<textus>,
# `solum:hauri` → octeti. The `norma:solum` wrappers `carpe`/`hauri` are
# module-private this release, so this fixture reaches the line/byte routes
# directly through the manifest-backed `ad` surface; the compiler's
# `@ radix typus` metadata on `norma:solum.read_file<T>` still admits the broader
# targets, which the provider rejects (recorded residual). Generic
# `solum.read_file<T>` across all three shapes is separate future provider work.
#
# Runtime check: files are prepared under /tmp so each read route can prove its
# accepted result shape independently of the harness working directory.
import from "norma:solum" solum
main {
const string textPath ← "/tmp/faber-solum-lege-generic.txt"
solum.write_file(textPath, "prima\nsecunda\n")
const string body ← solum.read_file<string>(textPath)
assert body ≡ "prima\nsecunda\n"
const list<string> lineae ← call 'solum:carpe' (textPath) ↦ list<string>
assert lineae ≡ ["prima", "secunda"]
const bytes data ← call 'solum:hauri' (textPath) ↦ octeti
assert data ≡ |70 72 69 6d 61 0a 73 65 63 75 6e 64 61 0a|
print body
print lineae
print data
print "solum lege carpe hauri parata"
}Expected output:
prima
secunda
["prima", "secunda"]
[112, 114, 105, 109, 97, 10, 115, 101, 99, 117, 110, 100, 97, 10]
solum lege carpe hauri parata